﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MarginTrading.site
{
    public partial class MTLogin : System.Web.UI.MasterPage
    {
        public string LoginName
        {
            get
            {
                if(Session["UserName"] == null)
                {
                    return string.Empty;
                }
                else
                {
                    return Session["UserName"].ToString();
                }
                
            }
        }

        public string MainTitle
        {
            get
            {
                //string mainTitle = System.Configuration.ConfigurationManager.AppSettings["MainTitle"].ToString();
                //if (String.IsNullOrEmpty(mainTitle))
                //{
                    return string.Empty;
                //}
                //else
                //{
                //    return mainTitle;
                //}

            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void lnkHome_Click(object sender, EventArgs e)
        {
            Response.Redirect("Default.aspx");
        }

        protected void HeadLoginStatus_LoggedOut(object sender, EventArgs e)
        {
            Session["UserName"] = null;
        }

        protected void lbtLogOut_Click(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                Session["UserName"] = null;
                Session["UserType"] = null;
                Response.Redirect("ClientsLoanAccount.aspx");
            }
        }

        protected void lbtChangePass_Click(object sender, EventArgs e)
        {
            Response.Redirect("ChangePass.aspx");
        }
    }
}
